home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993 April: Penguin on DISC / ADC Developer CD (1993-04) (''Penguin On DISC'')_iso / Dev.CD Apr 93.iso / Utilities / MPW Interfaces 7.1 Beta / CIncludes / AIFF.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-28  |  4.1 KB  |  230 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        AIFF.h
  3.  
  4.     Contains:    Definition of AIFF file format componentes
  5.  
  6.     Copyright:    © 1989-1992 by Apple Computer, Inc., all rights reserved.
  7.  
  8. *** Warning: This is an alpha version of the Interfaces for Cube-E. 
  9. ***          Things may change.  Caveat Programmer.
  10.  
  11.  
  12. */
  13.  
  14. #ifndef __AIFF__
  15. #define __AIFF__
  16.  
  17. #ifndef __TYPES__
  18. #include <Types.h>
  19. #endif
  20.  
  21.  
  22. enum {
  23.  
  24.  
  25. #define AIFFID 'AIFF'
  26. #define AIFCID 'AIFC'
  27. #define FormatVersionID 'FVER'
  28. #define CommonID 'COMM'
  29. #define FORMID 'FORM'
  30. #define SoundDataID 'SSND'
  31. #define MarkerID 'MARK'
  32. #define InstrumentID 'INST'
  33. #define MIDIDataID 'MIDI'
  34. #define AudioRecordingID 'AESD'
  35. #define ApplicationSpecificID 'APPL'
  36. #define CommentID 'COMT'
  37. #define NameID 'NAME'
  38. #define AuthorID 'AUTH'
  39. #define CopyrightID '(c) '
  40. #define AnnotationID 'ANNO'
  41.  
  42.  NoLooping = 0,
  43.  ForwardLooping = 1,
  44.  ForwardBackwardLooping = 2,
  45.  
  46. /* AIFF-C Versions */
  47.  AIFCVersion1 = 0xA2805140
  48.  
  49.  
  50. /* Compression Names */
  51. #define NoneName "\pnot compressed"
  52. #define ACE2to1Name "\pACE 2-to-1"
  53. #define ACE8to3Name "\pACE 8-to-3"
  54. #define MACE3to1Name "\pMACE 3-to-1"
  55. #define MACE6to1Name "\pMACE 6-to-1"
  56.  
  57. /* Compression Types */
  58. #define NoneType 'NONE'
  59. #define ACE2Type 'ACE2'
  60. #define ACE8Type 'ACE8'
  61. #define MACE3Type 'MAC3'
  62. #define MACE6Type 'MAC6'
  63. };
  64.  
  65. typedef unsigned long ID;
  66. typedef short MarkerIdType;
  67.  
  68. struct ChunkHeader {
  69.  ID ckID;
  70.  long ckSize;
  71. };
  72.  
  73. typedef struct ChunkHeader ChunkHeader;
  74.  
  75. struct ContainerChunk {
  76.  ID ckID;
  77.  long ckSize;
  78.  ID formType;
  79. };
  80.  
  81. typedef struct ContainerChunk ContainerChunk;
  82.  
  83. struct FormatVersionChunk {
  84.  ID ckID;
  85.  long ckSize;
  86.  unsigned long timestamp;
  87. };
  88.  
  89. typedef struct FormatVersionChunk FormatVersionChunk;
  90. typedef FormatVersionChunk *FormatVersionChunkPtr;
  91.  
  92. struct CommonChunk {
  93.  ID ckID;
  94.  long ckSize;
  95.  short numChannels;
  96.  unsigned long numSampleFrames;
  97.  short sampleSize;
  98.  extended80 sampleRate;
  99. };
  100.  
  101. typedef struct CommonChunk CommonChunk;
  102. typedef CommonChunk *CommonChunkPtr;
  103.  
  104. struct ExtCommonChunk {
  105.  ID ckID;
  106.  long ckSize;
  107.  short numChannels;
  108.  unsigned long numSampleFrames;
  109.  short sampleSize;
  110.  extended80 sampleRate;
  111.  ID compressionType;
  112.  char compressionName[1];
  113. };
  114.  
  115. typedef struct ExtCommonChunk ExtCommonChunk;
  116. typedef ExtCommonChunk *ExtCommonChunkPtr;
  117.  
  118. struct SoundDataChunk {
  119.  ID ckID;
  120.  long ckSize;
  121.  unsigned long offset;
  122.  unsigned long blockSize;
  123. };
  124.  
  125. typedef struct SoundDataChunk SoundDataChunk;
  126. typedef SoundDataChunk *SoundDataChunkPtr;
  127.  
  128. struct Marker {
  129.  MarkerIdType id;
  130.  unsigned long position;
  131.  Str255 markerName;
  132. };
  133.  
  134. typedef struct Marker Marker;
  135.  
  136. struct MarkerChunk {
  137.  ID ckID;
  138.  long ckSize;
  139.  unsigned short numMarkers;
  140.  Marker Markers[1];
  141. };
  142.  
  143. typedef struct MarkerChunk MarkerChunk;
  144. typedef MarkerChunk *MarkerChunkPtr;
  145.  
  146. struct AIFFLoop {
  147.  short playMode;
  148.  MarkerIdType beginLoop;
  149.  MarkerIdType endLoop;
  150. };
  151.  
  152. typedef struct AIFFLoop AIFFLoop;
  153.  
  154. struct InstrumentChunk {
  155.  ID ckID;
  156.  long ckSize;
  157.  char baseFrequency;
  158.  char detune;
  159.  char lowFrequency;
  160.  char highFrequency;
  161.  char lowVelocity;
  162.  char highVelocity;
  163.  short gain;
  164.  AIFFLoop sustainLoop;
  165.  AIFFLoop releaseLoop;
  166. };
  167.  
  168. typedef struct InstrumentChunk InstrumentChunk;
  169. typedef InstrumentChunk *InstrumentChunkPtr;
  170.  
  171. struct MIDIDataChunk {
  172.  ID ckID;
  173.  long ckSize;
  174.  unsigned char MIDIdata[1];
  175. };
  176.  
  177. typedef struct MIDIDataChunk MIDIDataChunk;
  178. typedef MIDIDataChunk *MIDIDataChunkPtr;
  179.  
  180. struct AudioRecordingChunk {
  181.  ID ckID;
  182.  long ckSize;
  183.  unsigned char AESChannelStatus[24];
  184. };
  185.  
  186. typedef struct AudioRecordingChunk AudioRecordingChunk;
  187. typedef AudioRecordingChunk *AudioRecordingChunkPtr;
  188.  
  189. struct ApplicationSpecificChunk {
  190.  ID ckID;
  191.  long ckSize;
  192.  OSType applicationSignature;
  193.  char data[1];
  194. };
  195.  
  196. typedef struct ApplicationSpecificChunk ApplicationSpecificChunk;
  197. typedef ApplicationSpecificChunk *ApplicationSpecificChunkPtr;
  198.  
  199. struct Comment {
  200.  unsigned long timeStamp;
  201.  MarkerIdType marker;
  202.  unsigned short count;
  203.  char text[1];
  204. };
  205.  
  206. typedef struct Comment Comment;
  207.  
  208. struct CommentsChunk {
  209.  ID ckID;
  210.  long ckSize;
  211.  unsigned short numComments;
  212.  Comment comments[1];
  213. };
  214.  
  215. typedef struct CommentsChunk CommentsChunk;
  216. typedef CommentsChunk *CommentsChunkPtr;
  217.  
  218. struct TextChunk {
  219.  ID ckID;
  220.  long ckSize;
  221.  char text[1];
  222. };
  223.  
  224. typedef struct TextChunk TextChunk;
  225. typedef TextChunk *TextChunkPtr;
  226.  
  227.  
  228.  
  229. #endif
  230.